#!/bin/bash
#
# File Name Encoding Conversion Script
#
# Use this script to convert file names with special characters
# between Windows-1252 and UTF-8 encoded file systems.
# The script can be easily modified to convert between any 
# encoding to any other encoding.
#
# This script is similar to a script already available for the
# KDE desktop.
#
# changeFilenameCode
# http://kubuntu.free.fr/servicemenu/
#
# Original post:
# http://moto.debian.org.tw/viewtopic.php?t=5367
#
# Contributor:
# Adam Kane
# kane.adam@gmail.com
#
# The script has been modified to manage more than one 
# file and to specifically convert from windows-1252 to utf-8.
#
# Dependencies : convmv
# http://j3e.de/linux/convmv/

case $LANG in
    es*) MSG="conversion en progreso" ;;
    gl*) MSG="conversion en progreso" ;;
    *)  MSG="conversion in progress" ;;
esac

if [ $# -gt 0 ];then
convmv -f windows-1252 -t utf-8 -r --notest "$@"| zenity --progress --pulsate --text="$MSG" --auto-close
fi
exit 0 
